const mongoose = require("mongoose");
const Schema = mongoose.Schema;

const reportSchema = new mongoose.Schema({
  //发布者
  userId: {
    type: Schema.Types.ObjectId,
    ref: "User",
    require: true,
  },
  // 发布时间
  time: {
    type: Date,
    require: true,
  },
  //文件名
  fileName: {
    type: String,
    required: [true, "you must tell us your fileName"],
  },
  //文件对象（存储到文件服务器）
  fileObject: {
    type: Object,
    required: [true, "you must tell us your fileObject"],
  },
  //审核状态  pending审核中 pass 通过   reject 拒绝
  type: {
    type: String,
    enum: ["pending", "pass", "reject"],
    required: [true, "you must tell us your type"],
  },
});

const Report = mongoose.model("Report", reportSchema);
module.exports = Report;
